package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import edu.ynu.se.xiecheng.achitectureclass.dao.UserDao;
import edu.ynu.se.xiecheng.achitectureclass.entity.User;
import edu.ynu.se.xiecheng.achitectureclass.entity.Oorder;
import edu.ynu.se.xiecheng.achitectureclass.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "user实体的控制器")
@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController extends LogicController<UserService, UserDao,User,Long> {
    public UserController(@Autowired UserService us){
        super(us);
    }

    @ApiOperation("检测用户存在")
    @GetMapping ("/check/{username}")
    public Integer check(@PathVariable String username){
        return getService().checkUser(username);
    }
}
